package javajichu.xh.zhuoyei;

import java.util.Scanner;

public class jux {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入矩形宽和高");
        int q = input.nextInt();
        int w = input.nextInt();
        if (q>=3||w>=3){
            for (int i=0;i<q;i++){
                for (int j=0; j<w;j++){
                    if (i==0||i==q-1||j==0||j==w-1){
                        System.out.println("*");
                    }else{
                        System.out.println(" ");
                    }
                }
                System.out.println();
            }
        }

    }
}
